app.controller('sys_userController', ['$scope', 'httpWrapService', 'dialogs', '$state', '$stateParams','AppConstants','TableFactory',
        function($scope, httpWrapService, dialogs, $state, $stateParams,AppConstants, TableFactory) {
    $scope.params = {};
	var account = $scope.params.account = {
			field : 'u.account',
			type : AppConstants.filter.CONTAINS,
			term : ''
	};
	var name = $scope.params.name = {
			field : 'i.trueName',
			type : AppConstants.filter.CONTAINS,
			term : ''
	};
	var phone = $scope.params.phone = {
			field : 'i.phone',
			type : AppConstants.filter.CONTAINS,
			term : ''
	};
	
    $scope.Table1 = TableFactory.newInstance({
		url : 'system/user/list.do',
		params : [account,name,phone]
	});
    $scope.Table1.load();




    $scope['delete'] = function(id) {
        httpWrapService.defaultFootTableDelete($scope.Table1, id, 'system/user/delete/'+ id +'.do',{},'是否确定要删除用户？').then(function(res){
        	$scope.Table1.load();
        });
    };
    
    $scope['unLock'] = function(id) {
    	httpWrapService.defaultFootTableDelete($scope.Table1, id, 'system/user/unLock/'+ id +'.do',{},'是否确定要解锁用户？').then(function(res){
    		$scope.Table1.load();
    	});
    };
    
    $scope['lock'] = function(id) {
    	httpWrapService.defaultFootTableDelete($scope.Table1, id, 'system/user/lock/'+ id +'.do',{},'是否确定要锁定用户？').then(function(res){
    		$scope.Table1.load();
    	});
    };

}]);